<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Group
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 * @version    $Id: ProfileController.php 8091 2010-12-21 02:20:59Z john $
 * @author     John
 */

/**
 * @category   Application_Extensions
 * @package    Group
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 */
class Country_ProfileController extends Core_Controller_Action_Standard
{
  public function init()
  {
    // @todo this may not work with some of the content stuff in here, double-check
    $subject = null;
    if( !Engine_Api::_()->core()->hasSubject() )
    {
      $id = $this->_getParam('id');
      if( null !== $id )
      {
        $subject = Engine_Api::_()->getItem('country', $id);
        if( $subject && $subject->getIdentity() )
        {
          Engine_Api::_()->core()->setSubject($subject);
        }
      }
    }

    $this->_helper->requireSubject('country');
//    $this->_helper->requireAuth()->setNoForward()->setAuthParams(
//      $subject,
//      Engine_Api::_()->user()->getViewer(),
//      'view'
//    );
  }

  public function indexAction()
  {
    
    // Render
    $this->_helper->content
        ->setNoRender()
        ->setEnabled()
        ;
  }
  public function showflagAction(){
    $country_id = $this->_getParam('id');
    if(empty($country_id)){
        return $this->setNoRender();
    }
    
    $country = Engine_Api::_()->getItem('country_country', $country_id);
    if(!$country){
        return $this->setNoRender();
    }
    $this->view->title = $country->getTitle();
    
    $this->view->fag_normal = $country->getFLagTag('thumb.profile');
  }
  public function showbigmapAction(){
    $country_id = $this->_getParam('id');
    if(empty($country_id)){
        return $this->setNoRender();
    }
    
    $country = Engine_Api::_()->getItem('country_country', $country_id);
    if(!$country){
        return $this->setNoRender();
    }
    $this->view->title = $country->getTitle();
    
    $this->view->fag_normal = $country->getBigMapTag(null);
  }
}